

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class CDataOutputStream extends DataOutputStream {
    /**
     * Creates a new data output stream to write data to the specified
     * underlying output stream. The counter <code>written</code> is
     * set to zero.
     *
     * @param out the underlying output stream, to be saved for later
     *            use.
     * @see FilterOutputStream#out
     */
    public CDataOutputStream(OutputStream out) {
        super(out);
    }

    public void writeString(String str) throws IOException {
        for (int i = 0; i < str.length(); i++){
            this.writeByte(Integer.valueOf(str.charAt(i)));
        }
    }
}
